package com.example.dell.jakatra.util;

import android.content.Context;
import android.net.ConnectivityManager;

import com.example.dell.jakatra.JakatraApplication;

/**
 * Created by johnvi on 2017/3/10.
 * mail:229200348@qq.com
 */

public class NetUtil {
    public static boolean isNetworkAvailable() {
        ConnectivityManager manager = (ConnectivityManager) JakatraApplication.getInstance().getSystemService(Context.CONNECTIVITY_SERVICE);
        if (manager.getActiveNetworkInfo() != null) {
            return manager.getActiveNetworkInfo().isAvailable();
        }
        return false;
    }
}
